/*
 * Filename:    HcpmsStorageDAOImpl.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014-12-29
 */
package com.paic.mhis.hcpms.common.storage.intergration.dao.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.common.storage.dto.HcpmsStorageDataDTO;
import com.paic.mhis.hcpms.common.storage.intergration.dao.StorageDao;
import com.paic.pafa.biz.dao.BaseDAO;

@Component("storageDao")
public class StorageDaoImpl extends BaseDAO implements StorageDao {

	@Override
	public void insertStorageDataDto(HcpmsStorageDataDTO dto) {
		this._insert("storage.insertStorageDataDTO", dto);

	}

	@Override
	public void updateStorageDataDto(HcpmsStorageDataDTO dto) {
		this._update("storage.updateStorageDataDTO", dto);
	}

	@Override
	public HcpmsStorageDataDTO getStorageData(HcpmsStorageDataDTO dto) {
		List<HcpmsStorageDataDTO> list = (List<HcpmsStorageDataDTO>) this._queryForList("storage.queryStorageDataDTO",
				dto);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

	@Override
	public List<HcpmsStorageDataDTO> getStorageDataList(HcpmsStorageDataDTO dto) {
		return (List<HcpmsStorageDataDTO>) this._queryForList("storage.queryStorageDataDTO", dto);
	}

	@Override
	public void deleteStorageDate(HcpmsStorageDataDTO dto) {
		this._delete("storage.deleteStorageDate", dto);
	}

}
